package day02;

import java.util.Arrays;

//Lambda表达式
public class Demo1 {
    public static void main(String[] args) {
        inter1 i1=(String ab,Integer bc)->{};
        inter1 i2=(ab,bc)->{};
        inter2 i3=nums -> {};
        i1.test("adc",50);
        i3.test(new Integer[]{1,4,1,4});

        inter1 i4=(a,b)-> System.out.println(a+" "+b);
        //针对有返回值
        inter3 i5=(a,b)->{
            return a+b;
        };
        inter3 i6=(a,b)->a+b;

        //函数式接口  不仅
        //语法：类名::静态方法名
        inter4 i7=Arrays::sort;
        int[] nums={8,7,4,6,3};
        i7.test(nums);
        System.out.println();
    }
}
@FunctionalInterface
interface inter1{
    public void  test(String a,Integer b);
}
interface  inter2{
    public void test(Integer[] nums);
}
interface  inter3{
    public int test(int a,int b);
}
interface inter4{
    public void test(int[] abc);
}
